<?php
class NewsModel extends Model {
	public function get_primary_key() {
		return $this->primary_key = 'id'; //设置主键
	}
	public function get_fields() {
		return $this->get_table_fields();
	}

	public function getNewById($id)
	{
		try {
			//更新device_lib表数据
			$query = $this->db->query('select * from ca_news where id = '.$id);
			$result = $query->row_array();
		} catch (Exception $e) {
			log_message('error',  $e->getMessage());
		}
		return $result;
	}
}